

using System;
using System.Collections.Generic;
using System.Text;
using DataAccessLayer;
using EntityLayer;
using DataLayer;
using System.Data;
using InfraStructureLayer;

namespace BusinessLayer
{
	public class busNewsContents:BusinessBase
	{
		public busNewsContents() : base()
		{
		}
	
        public DataTable SelectNewsContentsByNewsId(entNewsContents parEntNewsContents)
        {
            try
            {
                datNewsContents insDatNewsContents = new datNewsContents();
                DbConnector insDbConnector = new DbConnector();
                return insDatNewsContents.SelectNewsContentsByNewsId(parEntNewsContents,insDbConnector);
            }
            catch (SFException ex)
            {
                this.ErrorMessage = ex.Message;
            }
            return null;
        }

        public void SelectNewsContentsByNewsIdAndLanguageId(entNewsContents parEntNewsContents)
        {
            try
            {
                datNewsContents insDatNewsContents = new datNewsContents();
                DbConnector insDbConnector = new DbConnector();
                insDatNewsContents.SelectNewsContentsByNewsIdAndLanguageId(parEntNewsContents, insDbConnector);
                if (parEntNewsContents.NewsContentId == 0)
                {
                    throw new SFBusinessException(GetErrorMessageMultilanguageString(43, new object[] { CurrentContext.Languages.Select("LanguageId=" + CurrentContext.LanguageId.ToString())[0]["LanguageName"].ToString() }));
                }
                parEntNewsContents.NewsBody = GenerateHandlerLink(parEntNewsContents.NewsBody);
                parEntNewsContents.NewsSummary = GenerateHandlerLink(parEntNewsContents.NewsSummary);
            }
            catch (SFException ex)
            {
                this.ErrorMessage = ex.Message;
            }
        }
	}
}